<?xml version="1.0" encoding="UTF-8"?>
<urlset> 
  <%
  var baiduUrl = config.url

  if (config.baidusitemap.url) {
    baiduUrl = config.baidusitemap.url
  }

  var url = baiduUrl + config.root;
  posts.forEach(function(post){
  if(post.categories){
%> <url>
    <loc><%- encodeURI(url + post.path) %></loc>
    <%  if(config.baidusitemap.isAutoAdapt){ %>
     <mobile type="pc,mobile" />
    <%  }%>
    <lastmod>
      <%= post.updated.toDate().toISOString().replace(/T.*$/i, "") || post.date.toDate().toISOString().replace(/T.*$/i, "") %>
    </lastmod>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
  </url><%}}) %>
</urlset>